home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-09-01 | 1.3 KB | 49 lines | [TEXT/MPS ] |
- ;
- ; © Copyright 1990 Apple Computer, Inc. All Rights Reserved.
- ;
- ; Programmed by Ricardo Batista, 07/06/90
- ;
- ; This glue code goes to the application we are loading
- ;
- ;
-
- INCLUDE 'Traps.a'
- INCLUDE 'SysEqu.a'
-
-
-
-
-
- GOTOAPP PROC EXPORT
-
- ; st LoadTrap ; for debugging
- link a6,#0 ; no locals
- lea myRegs,a0 ; place to save all registers
- movem.l d0-d7/a0-a7,(a0) ; save registers
- ; move.w SR,-(sp) ; save status register
- ; ori.w #$0400,SR ; disable interrupts for a little bit
- clr.l StkLowPt ; clear lowest recorded stack (before stack changes)
- move.l CurStackBase,a7 ; now we have a stack
- move.l CurrentA5,a5 ; now we have an a5
- ; move.w (sp)+,SR ; reenable interrupts
- move.l -4(a6),-(sp) ; this is the paramblock pointer
- moveq #0,d0 ; clear d0
- move.w CurJTOffset,d0 ; set offset to appl code in d0
- addi.l #2,d0 ; make it real offset to code
- move.l a5,a0 ; put a5 in a0
- adda.l d0,a0 ; now a5 points to first code entry
- jsr (a0) ; go to the application
- lea myRegs,a0 ; place where all registers were saved
- movem.l (a0),d0-d7/a0-a7 ; recover registers (including stack and a5)
- unlk a6 ; destroy stack frame
- rts ; return to caller
-
- ALIGN
- myRegs
- dcb.b 80,0 ; space to save the registers
-
- ENDP
-
-
-
- END